<?php
/**
 * @author huwhois<huwhois@163.com>
 */
namespace app\admin\controller;

use daswork\Controller;
use app\admin\model\User;

class Base extends Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->model = new User();
        session_start();
        if (!isset($_SESSION["admin"]) || $_SESSION["admin"] !== true) {
            //  验证失败，将 $_SESSION["admin"] 置为 false
            $_SESSION["admin"] = false;
            die("alert('您未登录, 请登录');<script>location.href='http://meeting.ecorr.org/admin/login/index';</script>");
        }
        $this->assign('username', $_SESSION['username']);
        $this->assign('userid', $_SESSION['userid']);
    }
}